package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.CityTargetBid;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.IncrementalBidPercentage;
import org.w3c.dom.Element;

public class GxCityTargetBid extends CityTargetBid {
    public GxCityTargetBid(Element element) {
        if (element.getElementsByTagName("City").getLength() > 0 &&
            element.getElementsByTagName("City").item(0).getChildNodes().getLength() > 0) {
            this.setCity(element.getElementsByTagName("City").item(0).getChildNodes().item(0).getNodeValue());
        }
        if (element.getElementsByTagName("IncrementalBid").getLength() > 0 &&
            element.getElementsByTagName("IncrementalBid").item(0).getChildNodes().getLength() > 0) {
            //this.setIncrementalBid(IncrementalBidPercentage.fromString(element.getElementsByTagName("IncrementalBid").item(0).getChildNodes().item(0).getNodeValue()));
            this.setBidAdjustment(Integer.parseInt(IncrementalBidPercentage.fromString(element.getElementsByTagName("IncrementalBid").item(0).getChildNodes().item(0).getNodeValue()).getValue()));
        }
    }
}
